<?php
	$EmpID = $_POST['EmpID'];
	$conn = new mysqli('localhost', 'root', '', 'sevenbits');
	$sql = "SELECT * FROM employees WHERE EmpID='$EmpID'";
	$result = $conn->query($sql);
	// if the $result contains at least one row
	if ($result->num_rows > 0) {
		$arrResults = array();
	  // output data of each row from $result
	  while($row = $result->fetch_assoc()) {
		$arrResults[] = array(
			'EmpID' => $row['EmpID'],
			'EmpFname' => $row['EmpFname'],
			'EmpLname' => $row['EmpLname'],
			'StartDate' => $row['StartDate'],
			'EndDate' => $row['EndDate'],
			'EmpStatus' => $row['EmpStatus'],
			'Address' => $row['Address'],
			'Email' => $row['Email'],
			'PhoneNum' => $row['PhoneNum'],
			'ManagerID' => $row['ManagerID']
			);
	  }
	}
	echo json_encode($arrResults);
?>